
package com.tonyodev.fetch2;

import com.tonyodev.fetch2.database.DownloadInfo;
import com.tonyodev.fetch2core.FetchObserver;
import com.tonyodev.fetch2core.Reason;

import java.util.List;

/**
 * Fetch observer for groups. This observer also specifies which download
 * triggers the onChanged in the group.
 *
 * @since 2021-06-14
 */
public interface FetchGroupObserver extends FetchObserver<List<DownloadInfo>> {
    /**
     * Method called when the download list has changed.
     *
     * @param data the download list.
     * @param triggerDownload the download that triggered the change.
     * @param reason the reason why onChanged was called for the triggered download.
     */
    void onChanged(List<DownloadInfo> data, DownloadInfo triggerDownload, Reason reason);
}
